<!DOCTYPE html>
<html ltypeng="en">
<head>
	<meta charset="UTF-8">
	<title>Checkbox changing</title>
</head>
<body>
	<div>
		<input type="checkbox" name="a" value="1" onclick="changeA(this.value);">1
		<input type="checkbox" name="a" value="2" onclick="changeA(this.value);">2
		<input type="checkbox" name="a" value="3" onclick="changeA(this.value);">3
		<input type="checkbox" name="a" value="4" onclick="changeA(this.value);">4
		<input type="checkbox" name="a" value="5" onclick="changeA(this.value);">5
	</div>

	<div>
		<input type="checkbox" name="b">a
		<input type="checkbox" name="b">b
		<input type="checkbox" name="b">c
		<input type="checkbox" name="b">d
		<input type="checkbox" name="b">e
	</div>

	<script type="text/javascript">
		function changeA(value) {
			alert(value);
		}
	</script>

</body>
</html>